package com.hackintosh.shopping;

/**
 * @description：
 * @author：twislyn
 * @date：Created in 2021/05/15
 * @modified By：
 * @version: 1.0
 */
public class ShoppingTest {

    public static void main(String[] args) {
        Bag bigBag, mediumBag, smallRedBag, smallWhiteBag;

        Goods sp;
        bigBag = new Bag("大袋子");
        mediumBag = new Bag("中袋子");
        smallRedBag = new Bag("红色小袋子");
        smallWhiteBag = new Bag("白色小袋子");

        sp = new Goods("婺源特产", 2, 7.9f);
        smallRedBag.add(sp);
        sp = new Goods("婺源地图", 1, 9.9f);
        smallRedBag.add(sp);
        sp = new Goods("韶关香菇", 2, 68);
        smallWhiteBag.add(sp);
        sp = new Goods("韶关红茶", 3, 180);
        smallWhiteBag.add(sp);
        sp = new Goods("景德镇瓷器", 1, 380);
        mediumBag.add(sp);
        mediumBag.add(smallRedBag);
        sp = new Goods("李宁牌运动鞋", 1, 198);
        bigBag.add(sp);
        bigBag.add(smallWhiteBag);
        bigBag.add(mediumBag);
        System.out.println("您选购的商品有：");
        bigBag.show();
        float total = bigBag.calculate();
        System.out.println("要支付的总价是：" + total + "元");
    }

}
